package com.example.mountainwalker.mapper;

import org.apache.ibatis.annotations.*;
import com.example.mountainwalker.entity.GroupTourRegistrationInfo;

import java.util.List;

@Mapper
public interface GroupTourRegistrationMapper {
    @Select("SELECT * FROM mw.grouptourregistration")
    List<GroupTourRegistrationInfo> getGroupTourRegistrationInfo();

    @Select("select * from mw.grouptourregistration where RegistrationID= #{RegistrationID}")
    GroupTourRegistrationInfo getGroupTourRegistrationInfoById(Integer RegistrationID);

    @Delete("delete from mw.grouptourregistration where RegistrationID= #{RegistrationID}")
    int deleteGroupTourRegistrationInfoById(Integer RegistrationID);

    @Insert("insert into mw.grouptourregistration (GroupTourID,UserID,UserName,UserGender,UserPhone,TransactionAmount, RegistrationTime) " +
            "values(#{GroupTourID}, #{UserID}, #{UserName}, #{UserGender}, #{UserPhone}, #{TransactionAmount}, #{RegistrationTime})")
    int insertGroupTourRegistrationInfo(GroupTourRegistrationInfo groupTourRegistrationInfo);

    @Update("update mw.grouptourregistration set " +
            "GroupTourID=#{GroupTourID}, " +
            "UserID=#{UserID}, " +
            "UserName=#{UserName}, " +
            "UserGender=#{UserGender}, " +
            "UserPhone=#{UserPhone}, " +
            "TransactionAmount=#{TransactionAmount}, " +
            "RegistrationTime=#{RegistrationTime}"+
            "WHERE RegistrationID=#{RegistrationID}")
    int updateGroupTourRegistrationInfo(GroupTourRegistrationInfo groupTourRegistrationInfo);




}
